﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="KMrpt18.aspx.cs" Inherits="KMrpt18" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>仓库人员完成表</title>
    <script src="js/extTools.js" type="text/javascript"></script>
    <style>
        .x-grid-row-over .x-grid-cell-inner
        {
            font-weight: bold;
        }
        .x-grid-body .x-grid-cell-Cost
        {
            background-color: #f1f2f4;
        }
        
        .x-grid-row-summary .x-grid-cell-Cost .x-grid-cell-inner
        {
            background-color: #e1e2e4;
        }
        
        .task .x-grid-cell-inner
        {
            padding-left: 15px;
        }
        
        .x-grid-row-summary .x-grid-cell-inner
        {
            font-weight: bold;
            font-size: 11px;
            background-color: #f1f2f4;
        }
    </style>
    <script>
        var areachange = function (obj) {
            //alert(obj.value);
            CompanyX.binStock(obj.value);
        }
        var changetype = function (ojb) {
            App.GridPanel1.down('#Column7').hide();
            App.GridPanel1.down('#Column10').hide();
            App.GridPanel1.down('#Column13').hide();
            App.GridPanel1.down('#Column16').hide();
            App.GridPanel1.down('#Column19').hide();
            App.GridPanel1.down('#Column22').hide();

            var str = ojb.getValue().toString().split(",");
            for (i = 0; i < str.length; i++) {
                if (str[i] == "0") {
                    App.GridPanel1.down('#Column7').show();
                } else if (str[i] == "2") {
                    App.GridPanel1.down('#Column10').show();
                } else if (str[i] == "3") {
                    App.GridPanel1.down('#Column13').show();
                } else if (str[i] == "4") {
                    App.GridPanel1.down('#Column16').show();
                } else if (str[i] == "5") {
                    App.GridPanel1.down('#Column19').show();
                } else if (str[i] == "6") {
                    App.GridPanel1.down('#Column22').show();
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Neptune" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
            <Items>
                <ext:Hidden ID="FormatType" runat="server" />
                <ext:GridPanel ID="GridPanel1" runat="server" TitleAlign="Center">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server" Layout="Container">
                            <Items>
                                <ext:Toolbar ID="Toolbar3" runat="server" Layout="ColumnLayout">
                                    <Items>
                                        <ext:DateField runat="server" ID="txtbdate" FieldLabel="日期" Format="yyyy-MM-dd HH:mm:ss" />
                                        <ext:Label ID="Label1" runat="server" Text="-">
                                        </ext:Label>
                                        <ext:DateField runat="server" ID="txtedate" Format="yyyy-MM-dd HH:mm:ss" />
                                        <ext:TextField runat="server" FieldLabel="波次号" ID="txtBillNO" />
                                        <ext:Component runat="server" Width="1500" Padding="5">
                                        </ext:Component>
                                        <ext:ComboBox runat="server" ID="txtStock" FieldLabel="仓库" DisplayField="stockname"
                                            ValueField="stockid">
                                            <Store>
                                                <ext:Store runat="server">
                                                    <Model>
                                                        <ext:Model runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="stockid" />
                                                                <ext:ModelField Name="stockname" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <Items>
                                                <ext:ListItem>
                                                </ext:ListItem>
                                            </Items>
                                        </ext:ComboBox>
                                        <ext:ComboBox runat="server" ID="txtPerson" FieldLabel="人员" DisplayField="UserName"
                                            ValueField="PersonnelID">
                                            <Store>
                                                <ext:Store ID="Store2" runat="server">
                                                    <Model>
                                                        <ext:Model ID="Model1" runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="PersonnelID" />
                                                                <ext:ModelField Name="UserName" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <Items>
                                                <ext:ListItem>
                                                </ext:ListItem>
                                            </Items>
                                        </ext:ComboBox>
                                        <ext:MultiCombo runat="server" ID="cbtype" FieldLabel="任务类型">
                                            <Items>
                                                <ext:ListItem Value="0" Text="收货验货">
                                                </ext:ListItem>
                                                <ext:ListItem Value="2" Text="拣货">
                                                </ext:ListItem>
                                                <ext:ListItem Value="3" Text="播种">
                                                </ext:ListItem>
                                                <ext:ListItem Value="4" Text="上架">
                                                </ext:ListItem>
                                                <ext:ListItem Value="5" Text="点数复合">
                                                </ext:ListItem>
                                                <ext:ListItem Value="6" Text="出库交接">
                                                </ext:ListItem>
                                            </Items>
                                            <Listeners>
                                                <Change Fn="changetype">
                                                </Change>
                                            </Listeners>
                                        </ext:MultiCombo>
                                        <ext:Button ID="Button1" runat="server" Text="查询" OnDirectClick="BtnQureyUser" UI="Info"
                                            Icon="Find">
                                            <DirectEvents>
                                                <Click Timeout="90000">
                                                    <EventMask ShowMask="true" Msg="加载中...">
                                                    </EventMask>
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                    </Items>
                                </ext:Toolbar>
                                <ext:Toolbar ID="Toolbar2" runat="server">
                                    <Items>
                                        <ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="排序区域:" Reorderable="false" />
                                        <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" Reorderable="false" />
                                    </Items>
                                    <Plugins>
                                        <ext:BoxReorderer ID="BoxReorderer1" runat="server">
                                            <Listeners>
                                                <Drop Handler="changeSortDirection(dragCmp, false);" />
                                            </Listeners>
                                        </ext:BoxReorderer>
                                        <ext:ToolbarDroppable ID="ToolbarDroppable1" runat="server">
                                            <CreateItem Fn="createItem" />
                                            <CanDrop Fn="canDrop" />
                                            <Listeners>
                                                <Drop Fn="doSort" />
                                            </Listeners>
                                        </ext:ToolbarDroppable>
                                    </Plugins>
                                </ext:Toolbar>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="500" OnReadData="RefreshDataSet"
                            GroupField="仓库职员" OnSubmitData="Store1_Submit">
                            <Model>
                                <ext:Model ID="Model2" runat="server">
                                    <Fields>
                                        <ext:ModelField Name="仓库" ServerMapping="stockname" Type="String" />
                                        <ext:ModelField Name="波次号" ServerMapping="billno" Type="String" />
                                        <ext:ModelField Name="来源单号" ServerMapping="sourcebill" Type="String" />
                                        <ext:ModelField Name="仓库职员" ServerMapping="username" Type="String" />
                                        <ext:ModelField Name="开始时间" ServerMapping="begdate" Type="Date" />
                                        <ext:ModelField Name="完成时间" ServerMapping="enddate" Type="Date" />
                                        <ext:ModelField Name="收货验货数量" ServerMapping="收货验货数量" />
                                        <ext:ModelField Name="收货验货用时" ServerMapping="收货验货用时" />
                                        <ext:ModelField Name="收货验货时效" ServerMapping="收货验货时效" />
                                        <ext:ModelField Name="拣货数量" ServerMapping="拣货数量"/>
                                        <ext:ModelField Name="拣货用时" ServerMapping="拣货用时" />
                                        <ext:ModelField Name="拣货时效" ServerMapping="拣货时效" />
                                        <ext:ModelField Name="播种数量" ServerMapping="播种数量" />
                                        <ext:ModelField Name="播种用时" ServerMapping="播种用时" />
                                        <ext:ModelField Name="播种时效" ServerMapping="播种时效"/>
                                        <ext:ModelField Name="上架数量" ServerMapping="上架数量" />
                                        <ext:ModelField Name="上架用时" ServerMapping="上架用时"  />
                                        <ext:ModelField Name="上架时效" ServerMapping="上架时效" />
                                        <ext:ModelField Name="点数复核数量" ServerMapping="点数复核数量" />
                                        <ext:ModelField Name="点数复核用时" ServerMapping="点数复核用时"  />
                                        <ext:ModelField Name="点数复核时效" ServerMapping="点数复核时效" />
                                        <ext:ModelField Name="出库交接数量" ServerMapping="出库交接数量" />
                                        <ext:ModelField Name="出库交接用时" ServerMapping="出库交接用时" />
                                        <ext:ModelField Name="出库交接时效" ServerMapping="出库交接时效"  />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                        <Columns>
                            <ext:Column ID="Column1" runat="server" Text="仓库" DataIndex="仓库" />
                            <ext:Column ID="Column2" runat="server" Text="波次号" DataIndex="波次号" Width="150"
                                SummaryType="Count">
                                <SummaryRenderer Handler="return ((value === 0 || value > 1) ? '(' + value +' 条数据)' : '(1 条数据)');" />
                            </ext:Column>
                            <ext:Column ID="Column3" runat="server" Text="来源单号" DataIndex="来源单号" Width="150" />
                            <ext:Column ID="Column4" runat="server" Text="仓库职员" DataIndex="仓库职员" />
                            <ext:Column ID="Column5" runat="server" Text="开始时间" DataIndex="开始时间" Width="150">
                                <Renderer Fn="date" />
                            </ext:Column>
                            <ext:Column ID="Column6" runat="server" Text="完成时间" DataIndex="完成时间" Width="150">
                                <Renderer Fn="date" />
                            </ext:Column>
                            <ext:Column ID="Column7" runat="server" Text="收货验货"  Width="150">
                                <Columns>
                                    <ext:Column ID="Column8" runat="server" Text="用时（秒）" DataIndex="收货验货用时" Width="100"
                                        SummaryType="Sum" />
                                    <ext:Column ID="Column9" runat="server" Text="数量" DataIndex="收货验货数量" Width="80" SummaryType="Sum" />
                                    <ext:Column ID="Column110" runat="server" Text="时效/(分)" DataIndex="收货验货时效" Width="80"
                                        SummaryType="Sum" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column10" runat="server" Text="拣货" Width="150">
                                <Columns>
                                    <ext:Column ID="Column11" runat="server" Text="用时（秒）" DataIndex="拣货用时" Width="100"
                                        SummaryType="Sum" />
                                    <ext:Column ID="Column12" runat="server" Text="数量" DataIndex="拣货数量" Width="80" SummaryType="Sum" />
                                    <ext:Column ID="Column113" runat="server" Text="时效/(分)" DataIndex="拣货时效" Width="80"
                                        SummaryType="Sum" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column13" runat="server" Text="播种" Width="150">
                                <Columns>
                                    <ext:Column ID="Column14" runat="server" Text="用时（秒）" DataIndex="播种用时" Width="100"
                                        SummaryType="Sum" />
                                    <ext:Column ID="Column15" runat="server" Text="数量" DataIndex="播种数量" Width="80" SummaryType="Sum" />
                                    <ext:Column ID="Column116" runat="server" Text="时效/(分)" DataIndex="播种时效" Width="80"
                                        SummaryType="Sum" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column16" runat="server" Text="上架" Width="150">
                                <Columns>
                                    <ext:Column ID="Column17" runat="server" Text="用时（秒）" DataIndex="上架用时" Width="100"
                                        SummaryType="Sum" />
                                    <ext:Column ID="Column18" runat="server" Text="数量" DataIndex="上架数量" Width="80" SummaryType="Sum" />
                                    <ext:Column ID="Column119" runat="server" Text="时效/(分)" DataIndex="上架时效" Width="80"
                                        SummaryType="Sum" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column19" runat="server" Text="点数复核"  Width="150">
                                <Columns>
                                    <ext:Column ID="Column20" runat="server" Text="用时（秒）" DataIndex="点数复核用时" Width="100"
                                        SummaryType="Sum" />
                                    <ext:Column ID="Column21" runat="server" Text="数量" DataIndex="点数复核数量" Width="80"
                                        SummaryType="Sum" />
                                    <ext:Column ID="Column122" runat="server" Text="时效/(分)" DataIndex="点数复核时效" Width="80"
                                        SummaryType="Sum" />
                                </Columns>
                            </ext:Column>
                            <ext:Column ID="Column22" runat="server" Text="出库交接"  Width="150">
                                <Columns>
                                    <ext:Column ID="Column23" runat="server" Text="用时（秒）" DataIndex="出库交接用时" Width="100"
                                        SummaryType="Sum" />
                                    <ext:Column ID="Column24" runat="server" Text="数量" DataIndex="出库交接数量" Width="80"
                                        SummaryType="Sum" />
                                    <ext:Column ID="Column25" runat="server" Text="时效/(分)" DataIndex="出库交接时效" Width="80"
                                        SummaryType="Sum" />
                                </Columns>
                            </ext:Column>
                        </Columns>
                    </ColumnModel>
                    <Features>
                        <ext:Summary ID="Summary1" runat="server">
                        </ext:Summary>
                        <ext:GroupingSummary ID="GroupingSummary1" runat="server" GroupHeaderTplString="{name}"
                            HideGroupedHeader="true" EnableGroupingMenu="false" />
                    </Features>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                    </SelectionModel>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label2" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="500" />
                                        <ext:ListItem Text="1000" />
                                        <ext:ListItem Text="1500" />
                                        <ext:ListItem Text="2000" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="500" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button2" runat="server" Text="导出Excel" Icon="PageExcel">
                                    <Listeners>
                                        <Click Handler="exportData('xls');" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                    <Listeners>
                        <AfterLayout Handler="#{ToolbarDroppable1}.addDDGroup(this.child('headercontainer').reorderer.dragZone.ddGroup); doSort();"
                            Single="true" />
                    </Listeners>
                </ext:GridPanel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
